import request from "@/utils/request"

export default{
    // 获取会员信息
    getList(){
        return request({
            url: '/member/list',
            method: 'get'
        })
    },

    // page为当前页码，size为每页条数，searchMap为搜索条件
    search(page, size, searchMap){
        return request({
            url: `/member/list/search/${page}/${size}`,
            method: 'post',
            data: searchMap
        })
    },

    // 新增会员
    add(pojo){
        return request({
            url: '/member',
            method: 'post',
            data: pojo
        })
    },

    // 通过id查找会员信息
    getById(id){
        return request({
            url: `/member/${id}`,
            method: 'get'
        })
    },

    // 更新会员数据
    update(pojo){
        return request({
            url: `/member/${pojo.id}`,
            method: 'put',
            data: pojo
        })
    },

    // 删除会员
    deleteById(id){
        return request({
            url: `/member/${id}`,
            method: 'delete'
        })
    }
}